home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 1
/
CU Amiga Magazine CD-ROM Special Edition (1995)(EMAP Images)(GB)[Issue 1995-11].iso
/
Aminet
/
comm
/
mebbs
/
usage03.lha
/
usage.rexx
< prev
Wrap
OS/2 REXX Batch file
|
1994-07-08
|
4KB
|
69 lines
/* Usage Chart - Shows a bar chart of BBS Hourly Usage - by Larry Cloud M3001 */
bbsname="Kitt's Korner";bulpath="bulletins:"
parse arg line bulnum
if line < 1 | line > 9 then line=1
vers="0.3";bbs="For "bbsname" BBS";l=(80-length(bbs))/2%1;do i=1 to l;sp=sp||" ";end
if (upper(bulnum)="RESET") | (~exists("mebbsnet:configfiles/usage_"line".cfg")) then do
call open(file,"mebbsnet:configfiles/usage_"line".cfg","w");call writeln(file,"1")
do i=0 to 48;call writeln(file,"1");end
end
if bulnum="RESET" then bulnum=999
line=strip(line);bulnum=strip(bulnum);do i=0 to 24;tyme.i=0;end
do i=0 to 23;tyme.i=0;end;c=0;call open(file,"MEBBSNET:MEBBSNET"line".LOG","r")
do until eof(file)
x=readln(file)||" junk";parse upper var x junk1 junk2 tyme item junk3
if item="NORM." then sflag=tyme
if item="LOGOFF" then do;c=c+1;data.c.1=sflag;data.c.2=tyme;end
end;call close(file)
do i=0 to 23;e=i+1
do j=1 to c
if value(left(data.j.1,2))=i then do
a=value(right(data.j.1,2));b=value(right(data.j.2,2));d=b-a
if d>0 then do;tyme.i=tyme.i+d;end
else do;tyme.i=tyme.i+(60-a);tyme.e=tyme.e+b;end
end
end
end
do i=0 to 23
if tyme.i>60 then do
e=i+1;f=(tyme.i)-60;tyme.e=(tyme.e)+f;tyme.i=60
end
end
call open(file,"MEBBSNET:CONFIGFILES/usage_"line".CFG","R");days=readln(file)
do i=0 to 23;rawstat.i=readln(file);avestat.i=readln(file);end;call close(file);days=days+1
do i=0 to 23;rawstat.i=rawstat.i+tyme.i;avestat.i=(rawstat.i/days);end
call open(file,"MEBBSNET:CONFIGFILES/usage_"line".CFG","W");call writeln(file,days)
do i=0 to 23;call writeln(file,rawstat.i);call writeln(file,avestat.i);end;call close(file)
do i=0 to 23;x=avestat.i
do j=6 to 60 by 6;k=j/6;stats.i.k=" ";if x>=j then stats.i.k="XX"
end
do j=6 to 60 by 6;k=j/6;ans.i.k=" ";if x>=j then ans.i.k="²²"
end
end
string1=" Usage Chart version "vers" by Larry Cloud M3001";string2=" Chart For Line "line", averaged over "days" days."
call open(file,bulpath||"bul"bulnum".txt","W")
call writeln(file,string1);call writeln(file,string2);call writeln(file,sp||bbs);call writeln(file," ");call writeln(file," ")
s1=" 12 01 02 03 04 05 06 07 08 09 10 11 12 01 02 03 04 05 06 07 08 09 10 11";s2=" --------------------------------------------------------------------------"
s3="Numbers across are hours of the day, numbers down are minutes of use.";call writeln(file,s1);call writeln(file,s2)
do j=60 to 6 by -6;string=j;if j=6 then string="06"
string=string||"| "
do i=0 to 23;k=j/6;string=string||stats.i.k||" ";end
call writeln(file,string||"|")
end
call writeln(file,s2);call writeln(file,s1);call writeln(file," ");call writeln(file,s3)
call writeln(file," ");call writeln(file,"~vc ");call close(file)
string1="
Usage Chart
version
"vers"
by
Larry Cloud
M3001"
string2="
Chart For Line
"line"
, averaged over
"days"
days."
call open(file2,bulpath||"bul"bulnum".gr1","W")
call writeln(file2,string1);call writeln(file2,string2);call writeln(file2,sp||"
"bbs);call writeln(file2," ");call writeln(file2," ")
s1="
12 01 02 03 04 05 06 07 08 09 10 11 12 01 02 03 04 05 06 07 08 09 10 11";s2="
--------------------------------------------------------------------------"
call writeln(file2,s1);call writeln(file2,s2)
do j=60 to 6 by -6;string="
"||j;if j=6 then string="
06"
string=string||"|
"
do i=0 to 23;k=j/6;string=string||ans.i.k||" ";end
call writeln(file2,string||"
|")
end
call writeln(file2,s2);call writeln(file2,s1);call writeln(file2," ");call writeln(file2,s3);call writeln(file2," ");call writeln(file2,"~vc ");call close(file2)
say"Usage Chart - Another fine Arexx Script by Larry Cloud, M3001."
exit